
Component({
    options: {
        multipleSlots: true // 在组件定义时的选项中启用多slot支持
    },
    properties: {
        show: {
            type: Boolean,
            value: false
        },
        hasTopSpace: {
            type: Boolean,
            value: false
        },
        showSubmit: {
            type: Boolean,
            value: true
        },
        submitText: {
            type: String,
            value: '提交'
        },
        showCancel: {
            type: Boolean,
            value: true
        },
        cancelText: {
            type: String,
            value: '取消'
        },
        showClose: {
            type: Boolean,
            value: true
        },
        showCloseBtn: {
            type: Boolean,
            value: false
        },
    },
    data: {
        navBarHeight: 0,
    },
    lifetimes: {
        ready() {
            if(this.data.hasTopSpace) {
                const systemInfo = wx.getSystemInfoSync();
                this.setData({
                    navBarHeight: systemInfo.statusBarHeight + 22,
                });
            }
        }
    },
    methods: {
        submit() {
            this.triggerEvent('submit');
        },
        cancel() {
            this.triggerEvent('cancel');
        },

        close() {
            this.triggerEvent('close');
        }
    }
})